package com.qinggeng.project.system.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author smallfish
 */
@Table(name = "position")
@Data
public class Position implements Serializable {
    /**
     * 职位ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "id（新增和搜索时不填）")
    private Long id;

    /**
     * 职位名称
     */
    @ApiModelProperty(value = "职位名称",required = true)
    private String name;

    /**
     * 聊伴描述
     */
    @ApiModelProperty(value = "职位描述",required = true)
    private String describe;

    @ApiModelProperty(value = "应聘要求",required = true)
    private String demands;

    /**
     * 工作地点
     */
    @ApiModelProperty(hidden = true)
    private String place;

    /**
     * 薪资
     */
    @ApiModelProperty(value = "薪资",required = true)
    private String salary;

    /**
     * 学历
     */
    @ApiModelProperty(value = "学历",required = true)
    private String education;

    /**
     * 工作经验
     */
    @ApiModelProperty(value = "工作经验",required = true)
    private String experience;


    /**
     * 职位分类code
     */
    @ApiModelProperty(hidden = true)
    private String classifyCode;

    /**
     * 职位名称code
     */
    @ApiModelProperty(value = "职位名称code",required = true)
    private String positionCode;




    /**
     * 公司ID
     */
    @ApiModelProperty(value = "公司ID",required = true)
    private Long companyId;

    /**
     * 职位类型
     */
    @ApiModelProperty(value = "职位类型（10=全职 20=兼职）",required = true)
    private Integer type;


    /**
     * 发布者Id
     */
    @ApiModelProperty(hidden = true)
    private Long jobUserId;

    /**
     * 状态 10=审核中  20=审核通过 30=审核不通过
     */
    @ApiModelProperty(hidden = true)
    private String status;

    /**
     * 审核不通过原因
     */
    @ApiModelProperty(hidden = true)
    private String reason;

    /**
     * 浏览次数
     */
    @ApiModelProperty(hidden = true)
    private Integer browseCount;

    private String logo;

    private static final long serialVersionUID = 1L;

    public String getPositionName() {
        return this.name;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", name=").append(name);
        sb.append(", describe=").append(describe);
        sb.append(", place=").append(place);
        sb.append(", salary=").append(salary);
        sb.append(", education=").append(education);
        sb.append(", experience=").append(experience);
        sb.append(", companyId=").append(companyId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
